const initialState = {
    list:[],
    num:1,
    activeIndex:0,
}

export default (state = initialState, { type, payload }) => {
    let {list}=state
  switch (type) {
  case "ADD_NUM":
    return { ...state, ...payload }
  case "ACTIVE":
    activeIndex=payload
        return { ...state,   activeIndex }

  case "GET_LIST":
      list=payload
        return {
       ...state, 
       list

         }
  default:
    return state
  }
}
